package com.pearadmin.pro.modules.mkt.service.impl;

import java.util.List;
import java.util.ArrayList;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.pearadmin.pro.common.web.base.page.PageResponse;
import com.pearadmin.pro.common.web.base.page.Pageable;

import com.pearadmin.pro.modules.mkt.domain.MktChannelSource;
import com.pearadmin.pro.modules.mkt.param.MktChannelSourceRequest;
import com.pearadmin.pro.modules.mkt.repository.MktChannelSourceRepository;
import com.pearadmin.pro.modules.mkt.service.MktChannelSourceService;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;


/**
 * 渠道来源Service业务层处理
 *
 * @author chenJian
 * @date 2021-09-09
 */
@Service
public class MktChannelSourceServiceImpl extends ServiceImpl<MktChannelSourceRepository, MktChannelSource> implements MktChannelSourceService
{
    @Resource
    private MktChannelSourceRepository mktChannelSourceRepository;

    /**
     * 查询渠道来源
     * @param request
     * @return 渠道来源 分页集合
     * */
    @Override
    public PageResponse<MktChannelSource> page(MktChannelSourceRequest request)
    {
        LambdaQueryWrapper<MktChannelSource> query = new LambdaQueryWrapper<MktChannelSource>();
        return Pageable.of(request,(()->  mktChannelSourceRepository.selectList(query)));
    }

    /**
     * 查询渠道来源
     *
     * @param id 渠道来源ID
     * @return 渠道来源
     */
    @Override
    public MktChannelSource selectMktChannelSourceById(Long id)
    {
        return mktChannelSourceRepository.selectById(id);
    }

}
